<?php defined('_JEXEC') or die('Restricted access'); ?>
<?php
	$document =& JFactory::getDocument();

	$document->addStyleSheet($this->baseurl. '/components/com_igallery/css/colorbox.css');

?>

<script>

	//jQuery(document).ready(function(){
		//Examples of how to assign the ColorBox event to elements
	//	jQuery("a[rel='igallery1']").colorbox();
		
	//});
</script>

<div class="igallery">
<!--
<div class="general">

<?php
	if( !empty($this->catInfo->menu_image_filename) ){
		if(! $fileArray = igFileHelper::originalToResized($this->catInfo->menu_image_filename, $this->catInfo->menu_max_width, 
		$this->catInfo->menu_max_height, $this->catInfo->img_quality, $this->catInfo->crop_menu, 0, $this->catInfo->round_menu, $this->catInfo->round_fill) )   {
			return false;
		}
		$folderName = $fileArray['folderName'];
		$fullFileName = $fileArray['fullFileName'];
		$image = IG_IMAGE_HTML_RESIZE . $folderName .'/'. $fullFileName;
	}else{
		$image = 'images/noimage.jpg';
	}
?>
	
	
	<p class="car-title">
		<span><?php echo JText::_('GIOI_THIEU_CATEGORY');?>:</span> <?php echo $this->catInfo->name;?>
	</p>
	<p class="cat-img">
		<img src="<?php echo $image;?>" alt="" width="<?php echo $item->thumb_width?>">
	</p>
		<?php echo $this->catInfo->gallery_description;?>

</div>
-->
<p class="car-title"><?php echo $this->catInfo->name;?></p>
<?php if(count($this->category) > 0){?>
	<?php foreach($this->category as $item){?>
	
	<?php 
	
	//var_dump($item);
	
	if( !empty($item->filename) ){
		if(! $thumbFiles = igFileHelper::originalToResized($item->filename, $item->thumb_width, 
		$item->thumb_height, $item->img_quality, $item->crop_thumbs, $item->rotation, $item->round_thumb, $item->round_fill) )
		{
			return false;
		}
		
		$folderName = $thumbFiles['folderName'];
		$fullFileName = $thumbFiles['fullFileName'];
		$image = IG_IMAGE_HTML_RESIZE . $folderName .'/'. $fullFileName;
		$fulImage = IG_IMAGE_HTML_ORIG . $folderName .'/'. $item->filename;
	}else{
		$image = 'images/noimage.jpg';
		$fulImage = '';
	}
	?>
		<div class="igallery-item">
			<p class="item_img">
			<?php if($fulImage != ''){ ?>
				<a href="<?php echo $fulImage?>" rel="igallery1">
					<img src="<?php echo $image;?>" alt="" width="<?php echo $item->thumb_width?>">
				</a>
			<?php }else{ ?>
				<img src="<?php echo $image;?>" alt="" width="<?php echo $item->thumb_width?>">
			<?php } ?>
			</p>
			<p class="item_name"><?php echo $this->catInfo->name;?></p>
			<p class="item_date"><span><?php echo JText::_('CAP_NHAT');?></span> <?php echo $item->date?></p>
			
		</div>
	
	<?php } ?>

	<div class="pagination">
		<div><?php echo $this->pagination->getPagesLinks(); ?></div>
	</div>
	
<?php }else{?>
	<?php echo JText::_('DATA_EMPTY');?>
<?php } ?>

</div>


